{% extends 'qa_base.html' %}
{% block content %}
        <div id="wrapper"> 
            <div id="room" style = 'padding:0px;'> 
                <div id="CAFull">               
                    <div id="mainbar-full"> 
                        <div id="subheader" class="headUser">{{user.name}}</div> 
                    <table class="user-info-table"> 
                    <tr> 
                    <td width="180" style="vertical-align:top;text-align:center;"> 
                        <table width="100%"> 
                         <tr> 
                            <td> 
                        <img class="gravatar" width="160" height="160" src="{% if user.image %}/{{user.image}}{%endif%}{%if not user.image%}/user_image/2011/08/05/test-image_1.jpg{%endif%}" alt="{{user.name}}'s  image" alt="{{user.name}}'s  image" /> 
                            </td> 
                        </tr> 
                        </table> 
                    </td> 
                <td width="300" style="vertical-align: top;"> 
        
            <table class="user-details"> 
                <tr> 
                    <th colspan="2" align="left"><h3>用户信息</h3></th> 
                </tr> 
                <tr>
                </tr>
                <tr> 
                    <td>昵称:</td> 
                    <td>{{user.name}}</td> 
                </tr> 
                
                <tr> 
                    <td>性别:</td> 
                    <td>{%if user.gender == 'M'%}男{%endif%}{% if user.gender != 'M' %}女{% endif %}</td> 
                </tr> 
                
                <tr> 
                    <td>注册时间:</td> 
                    <td>{{user.register_datetime}}</td> 
                </tr> 
                
                <tr> 
                    <td>最新登陆:</td> 
                    <td>{{user.last_login_datetime}}</td> 
                </tr> 
                
                
                
                <tr> 
                    <td>邮箱:</td> 
                    <td>{{user.email}}</td> 
                </tr> 
                
                
                <tr> 
                    <td>角色:</td> 
                    <td>{%if user.role_type == 'S'%}学生{%endif%}{%if user.role_type != 'S'%}教师{%endif%}</td> 
                </tr> 
                
                

                
                <tr>
                    <td>生日:</td>
                    <td>{% if not user.birthday %}未知{%endif%}{%if user.birthday%}{{user.birthday}}{%endif%}</td>
                </tr>

            </table> 
        </td> 
        <td width="400"> 
            <div class="user-about">个人简介：</br>{{user.description}}
            </div> 
        </td> 
    </tr> 
</table> 
                      <hr/>
  
        <a name="questions"></a> 
        <h2><span class="count">{{user.questions.all|length}}</span> Questions </h2> 
        
        <div id="listA" class="user-stats-table"> 
        {% for question in question_list %}	        
<div class="short-summary">

    <div class="counts">

        <div class="favorites">

            <span class="favorite-mark {%if question.favourite_record.all|length >= 1%}on{%endif%}" title = 'marked as favourite before' style = 'position:relative;top:10px;'></span>

            <div class="item-count"></div>

        </div>

        

        <div class="votes">

            <div class="item-count">{{question.vote_count}}</div>

            <div>票</div>

        </div >

        <div title="this question has an accepted answer" class="status answered-accepted answered">

            <div class="item-count">{{question.answer_set.all|length}}</div>

            <div>回答</div>

        </div>

        <div class="views">

             <div class="item-count">{{question.view_count}}</div>

             <div>浏览</div>

        </div>

    </div>



    <div class="question-summary-wrapper">

        <h2><a title="{{question.description|safe}}" href="/qa/questions/{{question.id}}/">{{question.title}}</a></h2>

        <div class="userinfo">

            <span class="relativetime" title="{{question.question_datetime|timesince}}">发表于{{question.question_datetime|timesince}}前 by</span>

             <a href="/qa/questions/users/{{question.questioner.id}}">{{question.questioner.name}} </a>
              <span title="{{user.questions.all|length}} questions">{{user.questions.all|length}}</span><span class="badge1">&#9679;</span><span class="badgecount" title = '{{user.answer_set.all|length}} answers'>{{user.answer_set.all|length}} </span>
        </div>



        <div class="tags">

 {% for tag in question.tags.all %} <a href="/qa/tags/{{tag.name}}/" class="post-tag tag-link-{{tag.name}}"
                                    title="see questions tagged '{{tag.name}}'" rel="tag">{{tag.name|slice:':12'}}{%if tag.name|length >= 12 %}..{%endif%}</a>
                                    {% endfor %}
        </div>
    </div>
</div> {% endfor %}
        </div> 
        <a name="answers"></a> 
        <h2><span class="count">{{user.answer_set.all|length}}</span> Answers </h2> 
        <div> 
        <div class="user-stats-table"> 
          {% for answer in answer_list%}
            <div class="answer-summary"> 
                    <div class=" answer-votes" 
                        title="the answer has been voted for {{answer.vote_count}} times "> 
                        {{answer.vote_count}}
                    </div> 
                <div class="answer-link"> 
                    <a href="/qa/questions/{{answer.question.id}}" title = '{{answer.description|safe}}'>{% if answer.description|length >= 106 %}{{answer.description|safe|slice:':106'}}..{%endif%}{% if answer.description|length <= 106 %}{{answer.description|safe}}{%endif%}</a> 
                </div> 
            </div> 
          {%endfor%}
        </div> 
           <hr/>
        <a name="votes"></a> 
        <h2><span class="count">{{vote_count.2}}</span> Votes
                
            </h2> 
        <div class="user-stats-table"> 
            <table> 
                <tr> 
                    <td width="60"> 
                        <img style="cursor: default;" src="/image/vote-arrow-up-on.png" alt="thumb up" /> 
                            <span title="该用户投的赞成票总数" class="vote-count">{{vote_count.0}}</span> 
 
                    </td> 
                    <td width="60"> 
                        <img style="cursor: default;" src="/image/vote-arrow-down-on.png" alt="thumb down" /> 
                            <span title="user voted down this many times" class="vote-count">{{vote_count.1}}</span> 
 
                    </td> 
                </tr> 
            </table> 
        </div> 
        <hr/>
        <a name="tags"></a> 
       <h2><span class="count">{{tag_list|length}}</span> Tags
                
            </h2> 
         <!--  
            <table class="tags"> 
   
            </table> 
        </div> 
        -->
                <div class="user-stats-table"> 
                    <p> </p> 
                    <ul class="tagsList tags" style = 'min-height:100px'> 
                    {% for tag in tag_list %}
                        <li> 
                            <a  class="tag-link-{{tag.name}}" href="/qa/tags/{{tag.name}}/" title="查看有关'{{tag.name}}'的问题" rel="tag">{{tag.name|slice:':22'}}{%if tag.name|length >= 22 %}..{%endif%}</a>
                            <span class="tag-number">&#215; {{tag.count}}</span> 
                            <br/> 
                        </li>                     
                    {% endfor %}
                    </ul> 
                </div> 
                </div> 
                <div id="tail" style="clear:both;">   </div> 
            </div> 
            <div class="spacer3"></div> 
        </div> 
{% endblock %}
